using uTILLIty.Rave.Contract.Configuration;
using uTILLIty.Rave.Contract.Exception;

namespace uTILLIty.Rave.Contract.StorageAdapter
{
	/// <summary>
	/// A service usually injected to a <see cref="IStorageAdapter"/> implementation
	/// so it can use the available member-resolution and caching infrastructure
	/// </summary>
  public interface IMemberResolver
  {
    /// <summary>
    /// Resolves a member-configuration by ID
    /// </summary>
		/// <exception cref="ConfigurationErrorException">If specified member could not be located in configuration</exception>
		Member ResolveMember(string memberId);

    /// <summary>
    /// Resolves a member's details from cache or store
    /// </summary>
    StorageMember ResolveStorageMember(Member member, bool tryCreate);
  }
}